<table class="noSpacing" style="width: 100%;height: 100%;">
    <tr>
        <td style="padding: 5px;">
            <input type="button" style="position: fixed;top: 59px;right: 10px;z-index: 1000" value="Full screen"
                onclick="$('#graphName').toggle();$('#headerTR').toggle();"
                >
            <div class="box-wrap" style="display: table;margin-left: auto;margin-right: auto;">
                <div class="box-heading">
                    <h4>
                        <i class="icon-tag"></i> 
                        <span class="glyphicon glyphicon-signal"></span>
                        รายได้เหนือต้นทุน (ข้อมูลตัวอย่าง)
                    </h4>
                </div>
                <div class="box-inner">
                    <table class="noSpacing"style="width: 100%;height: 100%;">
                        <tr>
                            <td style="vertical-align: middle">
                                <?php
                                    $val[]=863;
                                    $val[]=1065;
                                    $val[]=1196;
                                    $val[]=1611;
                                    $val[]=2064;
                                    $val[]=2113;
                                    $val[]=3599;
                                    $val[]=4250;
                                    $val[]=5088;
                                ?>
                                <div style="border: 1px solid #428bca;margin-left: auto;margin-right: auto;display: table;">
                                    <table class="noSpacing" style="margin-left: 30px;margin-right: 30px;">
                                        <tr>
                                            <?php
                                                for($i=0;$val[$i];$i++){
                                                    $height=$val[$i]/14;
                                                    ?>
                                            <td style="vertical-align: bottom;text-align: center;font-size: 80%;padding: 5px;">
                                                <?=  number_format($val[$i])?>
                                                <div 
                                                    style="
                                                        background-color: #428bca;
                                                        width: 30px;
                                                        height: <?=$height?>px;
                                                        margin-left: auto;
                                                        margin-right: auto;
                                                    "></div>
                                            </td>
                                                        <?php
                                                }
                                            ?>
                                        </tr>
                                        <tr>
                                            <?php
                                                for($i=0;$val[$i];$i++){
                                                    ?>
                                            <td style="vertical-align: bottom;text-align: center;font-size: 80%;padding: 5px;">
                                                <?=$i+1?>
                                            </td>
                                                        <?php
                                                }
                                            ?>
                                        </tr>
                                        <tr>
                                            <td colspan="<?=count($val)?>" style="text-align: center;font-size: 80%;">รายที่</td>
                                        </tr>
                                    </table>
                                </div>
                            </td>
                        </tr>
                    </table>
                </div>
            </div>
        </td>
    </tr>
</table>